package net.lab1024.sa.admin.module.business.category.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.lab1024.sa.admin.module.business.category.domain.entity.SynthesisRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface SynthesisRecordMapper extends BaseMapper<SynthesisRecord> {
    @Select("SELECT * FROM synthesis_record WHERE creator_id = #{creatorId} " +
            "AND create_time BETWEEN #{startTime} AND #{endTime}")
    List<SynthesisRecord> findByCreatorAndTimeRange(
            @Param("creatorId") String creatorId,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime);
}

